(0) Obligation:

The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, 1).


The TRS R consists of the following rules:

f(c(c(a, y, a), b(x, z), a)) → b(y, f(c(f(a), z, z)))
f(b(b(x, f(y)), z)) → c(z, x, f(b(b(f(a), y), y)))
c(b(a, a), b(y, z), x) → b(a, b(z, z))

Rewrite Strategy: INNERMOST

(1) DependencyGraphProof (BOTH BOUNDS(ID, ID) transformation)

The following rules are not reachable from basic terms in the dependency graph and can be removed:
f(c(c(a, y, a), b(x, z), a)) → b(y, f(c(f(a), z, z)))
f(b(b(x, f(y)), z)) → c(z, x, f(b(b(f(a), y), y)))

(2) Obligation:

The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, 1).


The TRS R consists of the following rules:

c(b(a, a), b(y, z), x) → b(a, b(z, z))

Rewrite Strategy: INNERMOST

(3) TrsToWeightedTrsProof (BOTH BOUNDS(ID, ID) transformation)

Transformed TRS to weighted TRS

(4) Obligation:

The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, 1).


The TRS R consists of the following rules:

c(b(a, a), b(y, z), x) → b(a, b(z, z)) [1]

Rewrite Strategy: INNERMOST

(5) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)

Infered types.

(6) Obligation:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

c(b(a, a), b(y, z), x) → b(a, b(z, z)) [1]

The TRS has the following type information:
c :: a:b → a:b → a → a:b
b :: a:b → a:b → a:b
a :: a:b

Rewrite Strategy: INNERMOST

(7) CompletionProof (UPPER BOUND(ID) transformation)

The TRS is a completely defined constructor system, as every type has a constant constructor and the following rules were added:

c(v0, v1, v2) → null_c [0]

And the following fresh constants:

null_c, const

(8) Obligation:

Runtime Complexity Weighted TRS where all functions are completely defined. The underlying TRS is:

Runtime Complexity Weighted TRS with Types.
The TRS R consists of the following rules:

c(b(a, a), b(y, z), x) → b(a, b(z, z)) [1]
c(v0, v1, v2) → null_c [0]

The TRS has the following type information:
c :: a:b:null_c → a:b:null_c → a → a:b:null_c
b :: a:b:null_c → a:b:null_c → a:b:null_c
a :: a:b:null_c
null_c :: a:b:null_c
const :: a

Rewrite Strategy: INNERMOST

(9) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID) transformation)

Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction.
The constant constructors are abstracted as follows:

a => 0
null_c => 0
const => 0

(10) Obligation:

Complexity RNTS consisting of the following rules:

c(z', z'', z1) -{ 0 }→ 0 :|: v0 >= 0, z1 = v2, v1 >= 0, z'' = v1, v2 >= 0, z' = v0
c(z', z'', z1) -{ 1 }→ 1 + 0 + (1 + z + z) :|: z >= 0, z' = 1 + 0 + 0, y >= 0, x >= 0, z'' = 1 + y + z, z1 = x

Only complete derivations are relevant for the runtime complexity.

(11) CompleteCoflocoProof (EQUIVALENT transformation)

Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo:

eq(start(V, V1, V2),0,[c(V, V1, V2, Out)],[V >= 0,V1 >= 0,V2 >= 0]).
eq(c(V, V1, V2, Out),1,[],[Out = 2 + 2*V3,V3 >= 0,V = 1,V4 >= 0,V5 >= 0,V1 = 1 + V3 + V4,V2 = V5]).
eq(c(V, V1, V2, Out),0,[],[Out = 0,V6 >= 0,V2 = V7,V8 >= 0,V1 = V8,V7 >= 0,V = V6]).
input_output_vars(c(V,V1,V2,Out),[V,V1,V2],[Out]).

CoFloCo proof output:
Preprocessing Cost Relations
=====================================

#### Computed strongly connected components
0. non_recursive : [c/4]
1. non_recursive : [start/3]

#### Obtained direct recursion through partial evaluation
0. SCC is partially evaluated into c/4
1. SCC is partially evaluated into start/3

Control-Flow Refinement of Cost Relations
=====================================

### Specialization of cost equations c/4
* CE 4 is refined into CE [5]
* CE 3 is refined into CE [6]


### Cost equations --> "Loop" of c/4
* CEs [5] --> Loop 4
* CEs [6] --> Loop 5

### Ranking functions of CR c(V,V1,V2,Out)

#### Partial ranking functions of CR c(V,V1,V2,Out)


### Specialization of cost equations start/3
* CE 2 is refined into CE [7,8]


### Cost equations --> "Loop" of start/3
* CEs [7,8] --> Loop 6

### Ranking functions of CR start(V,V1,V2)

#### Partial ranking functions of CR start(V,V1,V2)


Computing Bounds
=====================================

#### Cost of chains of c(V,V1,V2,Out):
* Chain [5]: 1
with precondition: [V=1,V2>=0,Out>=2,2*V1>=Out]

* Chain [4]: 0
with precondition: [Out=0,V>=0,V1>=0,V2>=0]


#### Cost of chains of start(V,V1,V2):
* Chain [6]: 1
with precondition: [V>=0,V1>=0,V2>=0]


Closed-form bounds of start(V,V1,V2):
-------------------------------------
* Chain [6] with precondition: [V>=0,V1>=0,V2>=0]
- Upper bound: 1
- Complexity: constant

### Maximum cost of start(V,V1,V2): 1
Asymptotic class: constant
* Total analysis performed in 31 ms.

(12) BOUNDS(1, 1)